//
//  BKLog.h
//  BukaLive
//
//  Created by 曹飞 on 2017/5/12.
//  Copyright © 2017年 曹飞. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface BKLog : NSObject<NSCoding>

@property (nonatomic,assign) NSInteger  sdk;            //客户端类型
@property (nonatomic,strong) NSString * nameSpace;      //机构（产品线信息）
@property (nonatomic,strong) NSString * room_sdk_id;    //房间SDK ID
@property (nonatomic,strong) NSString * user_id;        //用户ID
@property (nonatomic,assign) NSInteger role;            // 用户权限：1-教师，2-学生，3-助教
@property (nonatomic,strong) NSString * nickname;       //用户昵称
@property (nonatomic,strong) NSString * platform;       //平台描述（硬件信息）
@property (nonatomic,strong) NSString * os;             //操作系统（软件信息）
@property (nonatomic,strong) NSString * client_ip;      //客户端IP
@property (nonatomic,strong) NSString * account;        //账号信息（非必有）
@property (nonatomic,strong) NSString * request_args;   //请求参数
@property (nonatomic,strong) NSString * request_type;   //请求方式（GET、POST、OPTIONS、PUT、DELETE等）
@property (nonatomic,strong) NSString * request_url;    //完整URL（不含任何参数）
@property (nonatomic,strong) NSString * reply_args;     //客户端返回参数
@property (nonatomic,assign) NSInteger request_begintime;//请求开始时间【只能到毫秒】
@property (nonatomic,assign) NSInteger request_endtime; //请求结束时间（按信令登陆时返回的服务器时间同步）【只能到毫秒】【没有信令登录则用本地时间】
@property (nonatomic,assign) NSInteger http_code;        //HTTP状态码
@property (nonatomic,strong) NSString * error_info;     //错误信息

-(instancetype)initWithSdk:(NSInteger)__sdk
             withNameSpace:(NSString *)__nameSpace
             withRoomSdkID:(NSString *) __room_sdk_id
                withUserID:(NSString *) __user_id
                  withRole:(NSInteger) __role
              withNickName:(NSString *) __nickname
              withPlatform:(NSString *) __platform
                    withOS:(NSString *) __os
              withClientIP:(NSString *) __client_ip
               withAccount:(NSString *) __account
           withRequestArgs:(NSString *) __request_args
           withRequestType:(NSString *) __request_type
            withRequestURL:(NSString *) __request_url
             withReplyArgs:(NSString *) __reply_args
      withRequestBeginTime:(NSInteger) __request_begintime
        withRequestEndTime:(NSInteger) __request_endtime
              withHttpCode:(NSInteger) __http_code
             withErrorInfo:(NSString *) __error_info;

@end



//底层日志1
@interface BKLogLog : NSObject <NSCoding>

@property (nonatomic, assign) int level;
@property (nonatomic, assign) int code;
@property (nonatomic, strong) NSString *log;
@property (nonatomic, assign) int length;

- (instancetype)init:(NSString *)log
                code:(int)code
               level:(int)level
              length:(int)length;



@end


@interface BKLogLogRtcpStatus : NSObject <NSCoding>

@property (nonatomic,assign) unsigned int streamId;
@property (nonatomic,assign) unsigned int cumulative_lost;
@property (nonatomic,assign) unsigned int fraction_lost;
@property (nonatomic,assign) unsigned int jitter;
@property (nonatomic,assign) bool upload;

-(instancetype)init:(unsigned int)sid
              clost:(unsigned int)clost
              flost:(unsigned int)flost
                 ji:(unsigned int)ji
                 up:(bool)up;

@end
